﻿using DGIS.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DGIS.GscloudService.IService
{
    public interface IDownloadService
    {
        /// <summary>
        /// 新增下载任务
        /// </summary>
        /// <param name="item"></param>
        /// <param name="isResume"></param>
        /// <param name="download"></param>
        /// <returns></returns>
        bool AddDownloadFile(DownloadFile item,bool isResume,bool download, Func<string,int, int> callback);

        /// <summary>
        /// 更新下载任务
        /// </summary>
        /// <param name="item"></param>
        /// <returns></returns>
        bool ModifyDownloadFile(DownloadFile item);

        /// <summary>
        /// 暂停下载任务
        /// </summary>
        /// <param name="intPtr"></param>
        /// <returns></returns>
        bool StopDownload(IntPtr intPtr);

        /// <summary>
        /// 开始下载任务
        /// </summary>
        /// <param name="intPtr"></param>
        /// <returns></returns>
        bool StartDownload(IntPtr intPtr);

        /// <summary>
        /// 删除下载任务
        /// </summary>
        /// <param name="item"></param>
        /// <returns></returns>
        bool DelDownload(DownloadFile item);

        /// <summary>
        /// 获取未完成下载任务
        /// </summary>
        /// <returns></returns>
        List<DownloadFile> GetResumeDownloadFiles();

        /// <summary>
        /// 删除下载任务
        /// </summary>
        /// <returns></returns>
        List<DownloadFile> GetCompleteDownloadFiles();

        /// <summary>
        /// 删除下载记录
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        bool DelRecord(string id);
    }
}
